<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>这是div</div>
<script>
  //创建一个h1标签
  let h1 = document.createElement("h1");
  h1.innerText = "这是h1";
  //添加到body里面  document.body获取body元素对象
  document.body.append(h1);
  let i = document.createElement("img");
  i.src = "../b.jpg";
  document.body.append(i);
</script>
</body>
</html>